const { DataTypes } = require("sequelize");
const seq = require("../db/seq.js");
const Opticals = seq.define(
  "opticals",
  {
    opticalId: {
      type: DataTypes.INTEGER,
      allowNull: false,
      autoIncrement: true,
      primaryKey: true,
      comment: "节点ID",
    },
    nodeName: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "节点名称",
    },
    linkName: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "链路名称",
    },
    nodeCode: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "编号",
    },
    nodeType: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "类别",
    },
    longitude: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "经度",
    },
    latitude: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "纬度",
    },
    R:{
      type:DataTypes.STRING(10),
      allowNull:false,
      defaultValue:"",
      comment:"RGB颜色中的红色的值"
    },
    G:{
      type:DataTypes.STRING(10),
      allowNull:false,
      defaultValue:"",
      comment:"RGB颜色中的绿色的值"
    },
    B:{
      type:DataTypes.STRING(10),
      allowNull:false,
      defaultValue:"",
      comment:"RGB颜色中的蓝色的值"
    }, 
    Z:{
      type:DataTypes.STRING(10),
      allowNull:false,
      defaultValue:"",
      comment:"Z坐标"
    },
    /* GG:{
      type:DataTypes.STRING(10),
      allowNull:false,
      defaultValue:"",
      comment:"RGB颜色中的绿色的值"
    },
    BB:{
      type:DataTypes.STRING(10),
      allowNull:false,
      defaultValue:"",
      comment:"RGB颜色中的蓝色的值"
    }, */
  },
  {
    freezeTableName: true,
    timestamps: false,
  }
);
module.exports = Opticals;